package pam.repositories;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import pam.entities.Employe;

public interface EmployeRepository extends CrudRepository<Employe,Long> {

    //retourne les employés ayant le ss souhaité
    //join fetch e.indemnite i where e.idIndemnite = i.id force le fetch lasy a resseigner le champ idIndemnite
    @Query("select e from Employe e left join fetch e.indemnite i where e.idIndemnite = i.id and e.SS =?1")
    public Iterable<Employe> findBySS(String ss);
}
